package com.spa.infrastructure.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.spa.application.command.member.MemberOrderAddCommand;
import com.spa.application.command.member.MemberOrderExtAddCommand;
import com.spa.application.dto.PageResult;
import com.spa.application.dto.admin.*;
import com.spa.application.dto.massagist.MassagistOrderDTO;
import com.spa.application.dto.massagist.MassagistOrderDetailDTO;
import com.spa.application.dto.massagist.MassagistOrderListDTO;
import com.spa.application.dto.massagist.MassagistWithdrawOrderDetailDTO;
import com.spa.application.dto.member.MemberOrderDTO;
import com.spa.application.dto.member.MemberOrderDetailDTO;
import com.spa.application.dto.member.MemberOrderExtDTO;
import com.spa.application.dto.massagist.OrderListWithdrawDTO;
import com.spa.application.dto.shop.OrderListDTO;
import com.spa.application.dto.shop.ShopOrderAllDTO;
import com.spa.application.dto.shop.ShopWithdrawOrderDetailDTO;
import com.spa.application.dto.shop.ShopWithdrawOrderListDTO;
import com.spa.application.query.admin.FinanceOrderQuery;
import com.spa.application.query.admin.OrderQuery;
import com.spa.application.query.massagist.MassagistOrderQuery;
import com.spa.application.query.member.MemberOrderQuery;
import com.spa.application.query.shop.OrderListQuery;
import com.spa.domain.entity.OrderExt;
import com.spa.domain.entity.OrderInfo;
import com.spa.infrastructure.enums.dict.massagist.MassagistTypeEnum;
import com.spa.infrastructure.enums.dict.order.OrderOperStatusEnum;
import com.spa.infrastructure.enums.dict.order.OrderStatusEnum;
import com.spa.infrastructure.enums.withdraw.WithdrawStatusEnum;
import com.spa.infrastructure.repository.condition.OrderInfoCondition;
import com.spa.infrastructure.repository.po.OrderExtPO;
import com.spa.infrastructure.repository.po.OrderInfoPO;
import com.spa.infrastructure.util.CurrencyUtils;
import org.mapstruct.*;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
@MapperConfig(unmappedTargetPolicy = ReportingPolicy.WARN)
public interface OrderMapperStruct {

    OrderMapperStruct INSTANCE = Mappers.getMapper(OrderMapperStruct.class);

    @Mapping(source = "serviceQuantity", target = "orderCount")
    @Mapping(source = "couponId", target = "ticketId")
    OrderInfoPO commandMember2Po(MemberOrderAddCommand command);

    OrderExtPO commandMember2ExtPo(MemberOrderExtAddCommand command);

    List<OrderInfo> po2Entity4List(List<OrderInfoPO> po);

    OrderInfo po2Entity(OrderInfoPO po);

    Page<OrderInfo> po2Entity4Page(Page<OrderInfoPO> po);

    OrderInfoCondition query2Condition4Page(MemberOrderQuery query);

    @Mapping(source = "orderStatus", target = "status")
    @Mapping(source = "beginTime", target = "beginDate")
    @Mapping(source = "endTime", target = "endDate")
    @Mapping(source = "orderStatusList", target = "statusList")
    OrderInfoCondition query2Condition4Page(OrderQuery query);

    OrderInfoCondition query2Condition(OrderListQuery query, Long shopId);
    OrderInfoCondition query2Condition(MassagistOrderQuery query, Long massagistId);
    OrderInfoCondition query2Condition(MemberOrderQuery query, Long userId);

    @Mapping(source = "id", target = "orderId")
    @Mapping(source = "orderCode", target = "orderNo")
    @Mapping(source = "status", target = "orderStatus", qualifiedByName = "int2Enum")
    @Mapping(source = "serviceName", target = "serviceName")
    @Mapping(source = "orderExtList", target = "extList")
    @Mapping(source = "createTime", target = "orderTime")
    @Mapping(source = "priceType", target = "payType")
    @Mapping(source = "userName", target = "userName")
    @Mapping(source = "userPhone", target = "userPhone")
    @Mapping(source = "massagistName", target = "massagistName")
    @Mapping(source = "massagistPhone", target = "massagistPhone")
    @Mapping(source = "shopName", target = "shopName")
    @Mapping(source = "orderAddress.address", target = "serviceAddress")
    @Mapping(source = "appointTime", target = "serviceTime")
    @Mapping(source = "massageService.duration", target = "serviceDuration")
    @Mapping(source = "massageService.discountPrice", target = "servicePrice")
    OrderDetailDTO entity2OrderDetailDto(OrderInfo entity);

    @Mapping(source = "massageServiceEntity.duration", target = "extraServiceDuration")
    @Mapping(source = "massageServiceEntity.name", target = "serviceName")
    @Mapping(source = "orderPrice", target = "extraServicePrice")
    OrderDetailDTO.Ext entity2Ext(OrderExt ext);

    PageResult<OrderListDTO> entity2OrderListDTO4Page(Page<OrderInfo> page);

    @Mapping(source = "massagistName", target = "name")
    @Mapping(source = "serviceName", target = "serviceName")
    @Mapping(source = "createTime", target = "orderTime")
    @Mapping(source = "extTotalPrice", target = "extPrice")
    @Mapping(source = "status", target = "status", qualifiedByName = "int2Enum")
    OrderListDTO entity2OrderListDTO(OrderInfo orderInfo);

    PageResult<MassagistOrderListDTO> entity2MassagistOrderListDTO4Page(Page<OrderInfo> page);

    @Mapping(source = "status", target = "status", qualifiedByName = "int2Enum")
    @Mapping(source = "orderOperStatus", target = "orderOperStatus", qualifiedByName = "int2Enum2")
    @Mapping(source = "orderAddress.name", target = "userName")
    @Mapping(source = "orderAddress.phone", target = "phone")
    @Mapping(source = "orderAddress.address", target = "address")
    @Mapping(source = "serviceName", target = "serviceName")
    @Mapping(source = "extTotalPrice", target = "extPrice")
    MassagistOrderListDTO entity2MassagistOrderListDTO(OrderInfo orderInfo);

    @Mapping(source = "orderAddress.name", target = "userName")
    @Mapping(source = "orderAddress.phone", target = "phone")
    @Mapping(source = "orderAddress.address", target = "address")
    @Mapping(source = "serviceName", target = "serviceName")
    @Mapping(source = "durationSum", target = "duration")
    @Mapping(source = "status", target = "status", qualifiedByName = "int2Enum")
    @Mapping(source = "orderOperStatus", target = "orderOperStatus", qualifiedByName = "int2Enum2")
    MassagistOrderDTO orderInfo2OorderInfoDTO(OrderInfo orderInfo);

    PageResult<com.spa.application.dto.admin.OrderListDTO> entity2AdminOrderListDTO4Page(Page<OrderInfo> page);

    @Mapping(source = "id", target = "orderId")
    @Mapping(source = "serviceName", target = "serviceName")
    @Mapping(source = "appointTime", target = "serviceTime")
    @Mapping(source = "orderAddress.name", target = "serviceUserName")
    @Mapping(source = "orderAddress.phone", target = "serviceUserPhone")
    @Mapping(source = "orderAddress.address", target = "serviceAddress")
    @Mapping(source = "userName", target = "userName")
    @Mapping(source = "userPhone", target = "userPhone")
    @Mapping(source = "massagistName", target = "massagistName")
    @Mapping(source = "massagistPhone", target = "massagistPhone")
    @Mapping(source = "shopName", target = "shopName")
    @Mapping(source = "orderTotalPrice", target = "actualPrice")
    @Mapping(source = "status", target = "orderStatus", qualifiedByName = "int2Enum")
    @Mapping(source = "orderOperStatus", target = "orderOperStatus", qualifiedByName = "int2Enum2")
    @Mapping(source = "createTime", target = "orderTime")
    com.spa.application.dto.admin.OrderListDTO entity2AdminOrderListDTO(OrderInfo page);

    PageResult<MemberOrderDTO> entity2MemberDto4Page(Page<OrderInfo> page);

    @Mapping(source = "serviceName", target = "serviceName")
    @Mapping(source = "massageService.cover", target = "serviceCover")
    @Mapping(source = "massagistName", target = "massagistName")
    @Mapping(source = "massagist.workPhoto", target = "massagistWorkPhoto")
    @Mapping(source = "status", target = "status", qualifiedByName = "int2Enum")
    @Mapping(source = "orderOperStatus", target = "operateStatus", qualifiedByName = "int2Enum2")
    MemberOrderDTO entity2MemberDto(OrderInfo orderInfo);

    @Mapping(source = "id", target = "orderDetailsDTO.id")
    @Mapping(source = "orderCode", target = "orderDetailsDTO.orderCode")
    @Mapping(source = "status", target = "orderDetailsDTO.orderStatus", qualifiedByName = "int2Enum")
    @Mapping(source = "orderOperStatus", target = "orderDetailsDTO.orderOperStatus", qualifiedByName = "int2Enum2")
    @Mapping(source = "travelType", target = "orderDetailsDTO.travelType")
    @Mapping(source = "travelPrice", target = "orderDetailsDTO.travelPrice")
    @Mapping(source = "travelDist", target = "orderDetailsDTO.travelDistance")
    @Mapping(source = "ticket.rmb", target = "orderDetailsDTO.couponDeduction")
    @Mapping(source = "durationSum", target = "orderDetailsDTO.durationSum")
    @Mapping(source = "orderPrice", target = "orderDetailsDTO.total")
    @Mapping(source = "priceType", target = "orderDetailsDTO.priceType")
    @Mapping(source = "createTime", target = "orderDetailsDTO.createTime")
    @Mapping(source = "takeTime", target = "orderDetailsDTO.takeTime")
    @Mapping(source = "departTime", target = "orderDetailsDTO.departTime")
    @Mapping(source = "arriveTime", target = "orderDetailsDTO.arriveTime")
    @Mapping(source = "startTime", target = "orderDetailsDTO.startTime")
    @Mapping(source = "cancelTime", target = "orderDetailsDTO.cancelTime")
    @Mapping(source = "cancelReason", target = "orderDetailsDTO.cancelReason")
    @Mapping(source = "endTime", target = "orderDetailsDTO.endTime")
    @Mapping(source = "appointTime", target = "orderDetailsDTO.appointTime")
    @Mapping(source = "remark", target = "orderDetailsDTO.remark")
    @Mapping(source = "orderExtList", target = "orderDetailsDTO.orderExtList")
    @Mapping(source = "serviceId", target = "shopService.id")
    @Mapping(source = "massageService.cover", target = "shopService.cover")
    @Mapping(source = "massageService.recommendations", target = "shopService.recommendations")
    @Mapping(source = "serviceName", target = "shopService.name")
    @Mapping(source = "massageService.duration", target = "shopService.duration")
    @Mapping(source = "massageService.price", target = "shopService.price")
    @Mapping(source = "massageService.discountPrice", target = "shopService.discountPrice")
    @Mapping(source = "orderCount", target = "shopService.orderCount")
    @Mapping(source = "massageService.sex", target = "shopService.sexDefect")
    @Mapping(source = "massageService.targetGroup", target = "shopService.suitableType")
    @Mapping(source = "massageService.highlights", target = "shopService.shiningPoint")
    @Mapping(source = "massageService.highlightsTar", target = "shopService.tag")
    @Mapping(source = "massageService.massageServiceFlowList", target = "shopService.serveList")
    @Mapping(source = "massageService.note", target = "shopService.tabooDesc")
    @Mapping(source = "massageService.declaration", target = "shopService.instruction")
    @Mapping(source = "orderCount", target = "shopService.selectCount")
    @Mapping(source = "massagistId", target = "shopMassagist.id")
    @Mapping(source = "massagistPhone", target = "shopMassagist.phone")
    @Mapping(source = "massagist.status", target = "shopMassagist.status")
    @Mapping(source = "massagistName", target = "shopMassagist.name")
    @Mapping(source = "shopId", target = "shopMassagist.shopId")
    @Mapping(source = "shopName", target = "shopMassagist.shopName")
    @Mapping(source = "massagist.introduce", target = "shopMassagist.introduce")
    @Mapping(source = "massagist.workPhoto", target = "shopMassagist.workPhoto")
    @Mapping(source = "massagist.lifePhoto", target = "shopMassagist.lifePhoto")
    @Mapping(source = "massagist.lengthOfEmployment", target = "shopMassagist.lengthOfEmployment")
    @Mapping(source = "massagist.idCardTails", target = "shopMassagist.idCardTails")
    @Mapping(source = "massagist.idCardFront", target = "shopMassagist.idCardFront")
//    @Mapping(source = "orderAddress.id", target = "shopAddress.id")
    @Mapping(source = "orderAddress.name", target = "shopAddress.name")
    @Mapping(source = "orderAddress.phone", target = "shopAddress.phone")
    @Mapping(source = "orderAddress.region", target = "shopAddress.region")
    @Mapping(source = "orderAddress.address", target = "shopAddress.address")
    @Mapping(source = "orderAddress.isDefault", target = "shopAddress.isDefault")
    @Mapping(source = "massagist.tag", target = "shopMassagist.tag", qualifiedByName = "type2Enum")
    ShopOrderAllDTO entity2ShopDto(OrderInfo entity);

    @Mapping(source = "massageServiceEntity.cover", target = "cover")
    @Mapping(source = "massageServiceEntity.name", target = "serviceName")
    @Mapping(source = "orderPrice", target = "actualPrice")
    @Mapping(source = "massageServiceEntity.duration", target = "duration")
    @Mapping(source = "totalDuration", target = "totalDuration")
    @Mapping(source = "massageServiceEntity.discountPrice", target = "discountPrice")
    MemberOrderExtDTO entity2MemberOrderExtDTO(OrderExt ext);

    List<OrderExt> extEntity2MenumberOrderExtEntity4List(List<OrderExtPO> extEntity);

    OrderExt po2Entity(OrderExtPO po);

    OrderInfoPO entity2Po(OrderInfo entity);

    @Mapping(source = "status", target = "status", qualifiedByName = "int2Enum")
    @Mapping(source = "createTime", target = "appointTime")
    @Mapping(source = "orderOperStatus", target = "operateStatus", qualifiedByName = "int2Enum2")
    @Mapping(source = "orderAddress.name", target = "userDTO.name")
    @Mapping(source = "orderAddress.phone", target = "userDTO.phone")
    @Mapping(source = "orderAddress.address", target = "userDTO.address")
    @Mapping(source = "appointTime", target = "userDTO.appointTime")
    @Mapping(source = "ticket.rmb", target = "discount")
    @Mapping(source = "durationSum", target = "totalDuration")
    @Mapping(source = "orderPrice", target = "totalPrice")
    @Mapping(source = "serviceName", target = "serviceDTO.serviceName")
    @Mapping(source = "massageService.duration", target = "serviceDTO.duration")
    @Mapping(source = "orderCount", target = "serviceDTO.orderCount")
    @Mapping(source = "massageService.price", target = "serviceDTO.price")
    @Mapping(source = "massageService.discountPrice", target = "serviceDTO.discountPrice")
    @Mapping(source = "massageService.cover", target = "serviceDTO.cover")
    @Mapping(source = "massageService.recommendations", target = "serviceDTO.recommendations")
    @Mapping(source = "massagistName", target = "massagistName")
    @Mapping(source = "massagistId", target = "massagistId")
    @Mapping(source = "orderExtList", target = "orderExtList")
    MassagistOrderDetailDTO entity2MassagistOrderDetailDTO(OrderInfo orderInfo);

    @Mapping(source = "status", target = "status", qualifiedByName = "int2Enum")
    @Mapping(source = "createTime", target = "appointTime")
    @Mapping(source = "orderOperStatus", target = "operateStatus", qualifiedByName = "int2Enum2")
    @Mapping(source = "orderAddress.name", target = "userDTO.name")
    @Mapping(source = "orderAddress.phone", target = "userDTO.phone")
    @Mapping(source = "orderAddress.address", target = "userDTO.address")
    @Mapping(source = "appointTime", target = "userDTO.appointTime")
    @Mapping(source = "ticket.rmb", target = "discount")
    @Mapping(source = "durationSum", target = "totalDuration")
    @Mapping(source = "orderPrice", target = "totalPrice")
    @Mapping(source = "serviceName", target = "serviceDTO.serviceName")
    @Mapping(source = "massageService.duration", target = "serviceDTO.duration")
    @Mapping(source = "orderCount", target = "serviceDTO.orderCount")
    @Mapping(source = "massageService.price", target = "serviceDTO.price")
    @Mapping(source = "massageService.discountPrice", target = "serviceDTO.discountPrice")
    @Mapping(source = "massageService.cover", target = "serviceDTO.cover")
    @Mapping(source = "massageService.recommendations", target = "serviceDTO.recommendations")
    @Mapping(source = "massagistName", target = "massagistName")
    @Mapping(source = "massagistId", target = "massagistId")
    @Mapping(source = "massagist.workPhoto", target = "massagistWorkPhoto")
    @Mapping(source = "orderExtList", target = "orderExtList")
    MemberOrderDetailDTO entity2MemberOrderDetailDTO(OrderInfo orderInfo);


    @Mapping(source = "massageServiceEntity.name", target = "serviceName")
    @Mapping(source = "massageServiceEntity.duration", target = "duration")
    @Mapping(source = "massageServiceEntity.price", target = "price")
    @Mapping(source = "massageServiceEntity.discountPrice", target = "discountPrice")
    @Mapping(source = "massageServiceEntity.cover", target = "cover")
    MassagistOrderDetailDTO.OrderExtDTO entity2OrderExtDTO(OrderExt ext);

    @Mapping(source = "massageServiceEntity.name", target = "serviceName")
    @Mapping(source = "massageServiceEntity.duration", target = "duration")
    @Mapping(source = "massageServiceEntity.price", target = "price")
    @Mapping(source = "massageServiceEntity.discountPrice", target = "discountPrice")
    @Mapping(source = "massageServiceEntity.cover", target = "cover")
    MemberOrderDetailDTO.OrderExtDTO entity2OrderExtDTO2(OrderExt ext);

    PageResult<FinanceOrderListDTO> entity2FinanceOrderListDTO4Page(Page<OrderInfo> page);
    List<FinanceOrderListDTO> entity2FinanceOrderListDTO4List(List<OrderInfo> list);
    List<FinanceOrderListExportDTO> dto2FinanceOrderListExportDTO4List(List<FinanceOrderListDTO> list);

    @Mapping(source = "orderStatus", target = "orderStatus", qualifiedByName = "enum2Str")
    @Mapping(source = "servicePrice", target = "servicePrice", qualifiedByName = "fen2yuan")
    @Mapping(source = "extPrice", target = "extPrice", qualifiedByName = "fen2yuan")
    @Mapping(source = "travelPrice", target = "travelPrice", qualifiedByName = "fen2yuan")
    @Mapping(source = "totalPrice", target = "totalPrice", qualifiedByName = "fen2yuan")
    @Mapping(source = "ticketPrice", target = "ticketPrice", qualifiedByName = "fen2yuan")
    @Mapping(source = "payPrice", target = "payPrice", qualifiedByName = "fen2yuan")
    @Mapping(source = "massagistCommissionSharingPrice", target = "massagistCommissionSharingPrice", qualifiedByName = "fen2yuan")
    @Mapping(source = "massagistTotalPrice", target = "massagistTotalPrice", qualifiedByName = "fen2yuan")
    @Mapping(source = "shopCommissionSharingPrice", target = "shopCommissionSharingPrice", qualifiedByName = "fen2yuan")
    @Mapping(source = "payCommission", target = "payCommission", qualifiedByName = "fen2yuan")
    @Mapping(source = "platformCommissionSharingPrice", target = "platformCommissionSharingPrice", qualifiedByName = "fen2yuan")
    @Mapping(source = "platformActualPrice", target = "platformActualPrice", qualifiedByName = "fen2yuan")
    @Mapping(source = "massagistWithdrawPrice", target = "massagistWithdrawPrice", qualifiedByName = "fen2yuan")
    @Mapping(source = "shopWithdrawPrice", target = "shopWithdrawPrice", qualifiedByName = "fen2yuan")
    @Mapping(source = "massagistWithdrawStatus", target = "massagistWithdrawStatus", qualifiedByName = "int2Str")
    @Mapping(source = "shopWithdrawStatus", target = "shopWithdrawStatus", qualifiedByName = "int2Str")
    FinanceOrderListExportDTO dto2FinanceOrderListExportDTO(FinanceOrderListDTO financeOrderListDTO);

    @Mapping(source = "id", target = "orderId")
    @Mapping(source = "status", target = "orderStatus", qualifiedByName = "int2Enum")
    @Mapping(source = "createTime", target = "orderTime")
    @Mapping(source = "ticket.rmb", target = "ticketPrice")
    @Mapping(source = "priceType", target = "payType")
    @Mapping(source = "extTotalPrice", target = "extPrice")
    FinanceOrderListDTO entity2FinanceOrderListDTO(OrderInfo orderInfo);

    @Mapping(source = "orderStatusList", target = "statusList")
    OrderInfoCondition query2Condition(FinanceOrderQuery query);

    @Named("enum2Str")
    default String enum2Str(OrderStatusEnum status) {
        return status.getDesc();
    }

    @Named("int2Enum")
    default OrderStatusEnum int2Enum(int status) {
        return OrderStatusEnum.byCode(status);
    }

    @Named("int2Enum2")
    default OrderOperStatusEnum int2Enum2(int status) {
        return OrderOperStatusEnum.byCode(status);
    }

    @Named("type2Enum")
    default MassagistTypeEnum type2Enum(int type) {
        return MassagistTypeEnum.byCode(type);
    }

    @Named("fen2yuan")
    default String fen2yuan(int fen) {
        return CurrencyUtils.fenToYuan(fen).toString();
    }

    @Named("int2Str")
    default String int2Str(int status) {
        return WithdrawStatusEnum.byCode(status).getDesc();
    }
    @Mapping(source = "status",target = "status",qualifiedByName = "int2Enum")
    @Mapping(source = "orderAddress.address", target = "serviceAddress")
    OrderListWithdrawDTO entity2OrderListWithdrawDto(OrderInfo orderInfo);
    PageResult<OrderListWithdrawDTO> entity2OrderListWithdrawDto4Page(Page<OrderInfo> orderInfoPage);

    @Mapping(source = "id", target = "orderId")
    @Mapping(source = "orderCode", target = "orderNo")
    @Mapping(source = "status", target = "orderStatus", qualifiedByName = "int2Enum")
    @Mapping(source = "serviceName", target = "serviceName")
    @Mapping(source = "orderExtList", target = "extList")
    @Mapping(source = "createTime", target = "orderTime")
    @Mapping(source = "userName", target = "userName")
    @Mapping(source = "userPhone", target = "userPhone")
    @Mapping(source = "massagistName", target = "massagistName")
    @Mapping(source = "massagistPhone", target = "massagistPhone")
    @Mapping(source = "shopName", target = "shopName")
    @Mapping(source = "orderAddress.address", target = "serviceAddress")
    @Mapping(source = "massageService.discountPrice", target = "servicePrice")
    @Mapping(source = "ticket.rmb", target = "discount")
    MassagistWithdrawOrderDetailDTO entity2MassagistWithdrawOrderDetailDTO(OrderInfo orderInfo);

    @Mapping(source = "massageServiceEntity.duration", target = "extraServiceDuration")
    @Mapping(source = "massageServiceEntity.name", target = "serviceName")
    @Mapping(source = "orderPrice", target = "extraServicePrice")
    MassagistWithdrawOrderDetailDTO.Ext entity2MassagistWithdrawOrderDetailDTO(OrderExt ext);

    @Mapping(source = "status",target = "status",qualifiedByName = "int2Enum")
    @Mapping(source = "orderAddress.address", target = "serviceAddress")
    ShopWithdrawOrderListDTO entity2ShopWithdrawOrderListDTO(OrderInfo orderInfo);
    PageResult<ShopWithdrawOrderListDTO> entity2ShopWithdrawOrderListDTO4Page(Page<OrderInfo> orderInfoPage);

    @Mapping(source = "id", target = "orderId")
    @Mapping(source = "orderCode", target = "orderNo")
    @Mapping(source = "status", target = "orderStatus", qualifiedByName = "int2Enum")
    @Mapping(source = "serviceName", target = "serviceName")
    @Mapping(source = "orderExtList", target = "extList")
    @Mapping(source = "createTime", target = "orderTime")
    @Mapping(source = "userName", target = "userName")
    @Mapping(source = "userPhone", target = "userPhone")
    @Mapping(source = "massagistName", target = "massagistName")
    @Mapping(source = "massagistPhone", target = "massagistPhone")
    @Mapping(source = "shopName", target = "shopName")
    @Mapping(source = "orderAddress.address", target = "serviceAddress")
    @Mapping(source = "massageService.discountPrice", target = "servicePrice")
    @Mapping(source = "ticket.rmb", target = "discount")
    ShopWithdrawOrderDetailDTO entity2ShopWithdrawOrderDetailDTO(OrderInfo orderInfo);

    @Mapping(source = "massageServiceEntity.duration", target = "extraServiceDuration")
    @Mapping(source = "massageServiceEntity.name", target = "serviceName")
    @Mapping(source = "orderPrice", target = "extraServicePrice")
    ShopWithdrawOrderDetailDTO.Ext entity2ShopWithdrawOrderDetailExtDTO(OrderExt ext);

    PageResult<MassagistOrderListWithdrawDTO> entity2MassagistOrderListWithdrawDto4Page(Page<OrderInfo> orderInfoPage);

    @Mapping(source = "status",target = "status",qualifiedByName = "int2Enum")
    @Mapping(source = "orderAddress.address", target = "serviceAddress")
    MassagistOrderListWithdrawDTO entity2MassagistOrderListWithdrawDto(OrderInfo orderInfo);

    @Mapping(source = "id", target = "orderId")
    @Mapping(source = "orderCode", target = "orderNo")
    @Mapping(source = "status", target = "orderStatus", qualifiedByName = "int2Enum")
    @Mapping(source = "serviceName", target = "serviceName")
    @Mapping(source = "orderExtList", target = "extList")
    @Mapping(source = "createTime", target = "orderTime")
    @Mapping(source = "userName", target = "userName")
    @Mapping(source = "userPhone", target = "userPhone")
    @Mapping(source = "massagistName", target = "massagistName")
    @Mapping(source = "massagistPhone", target = "massagistPhone")
    @Mapping(source = "shopName", target = "shopName")
    @Mapping(source = "orderAddress.address", target = "serviceAddress")
    @Mapping(source = "massageService.discountPrice", target = "servicePrice")
    @Mapping(source = "ticket.rmb", target = "discount")
    AdminWithdrawOrderDetailDTO entity2AdminWithdrawOrderDetailDTO(OrderInfo orderInfo);


    @Mapping(source = "massageServiceEntity.duration", target = "extraServiceDuration")
    @Mapping(source = "massageServiceEntity.name", target = "serviceName")
    @Mapping(source = "orderPrice", target = "extraServicePrice")
    AdminWithdrawOrderDetailDTO.Ext entity2AdminWithdrawOrderDetailExtDTO(OrderExt ext);

    PageResult<com.spa.application.dto.admin.ShopWithdrawOrderListDTO> entity2AdminShopWithdrawOrderListDTO4Page(Page<OrderInfo> orderInfoPage);
    @Mapping(source = "status",target = "status",qualifiedByName = "int2Enum")
    @Mapping(source = "orderAddress.address", target = "serviceAddress")
    com.spa.application.dto.admin.ShopWithdrawOrderListDTO entity2AdminShopWithdrawOrderListDTO(OrderInfo orderInfo);
}
